package com.hhkj.study.api.article.controller;

import com.hhkj.study.api.article.biz.ApiArticleBizService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author luowu
 * @Date 2024/10/8 涵 11:52:25
 */
@RestController
@RequestMapping("/api/article")
public class ApiArticleController {

    @Resource
    private ApiArticleBizService apiArticleBizService;

    /**
     * 下载免费资料
     * @return
     */
    @GetMapping("/download/{id}")
    public AjaxResult downloadArticle(@PathVariable("id") Long id){
        return AjaxResult.success(apiArticleBizService.downloadArticle(id));
    }
}
